/**@description 全局配置 */

/**
 * @description 游戏类型 语言包用到，定义好之前，请不要随意修改顺序，以免读取语言包错误
 */
enum Types {
    aimLine,
    eliminate,
    loadTest,
    netTest,
    nodePoolTest,
    tankBattle,
    shaders,
    resources,
    hall,
    scratchTicket,
    escapeStation,
    snapshot,
    stateMachine,
    qrcode,
    hollowOut,
}

//排序规则
enum Sort {
    resources = 0,
    hall,
    aimLine,
    eliminate,
    loadTest,
    netTest,
    tankBattle,
    shaders,
    nodePoolTest,
    scratchTicket,
    snapshot,
    stateMachine,
    qrcode,
    hollowOut,
    //私有项目
    private,
    escapeStation,
}

const eTypes = cc.Enum(Types)

export namespace Config {
    /**@description 是否显示调试按钮 */
    export const isShowDebugButton = true;

    /**@description 公共音效路径 */
    export const audioPath = {
        dialog: "common/audio/dlg_open",
        button: "common/audio/btn_click",
    }

    /**@description 是否跳过热更新检测 */
    export const isSkipCheckUpdate = false;

    /**@description 测试热更新服务器地址 */
    export const HOT_UPDATE_URL = "http://192.168.2.241/hotupdate247";

    /**@description 是否使用了自动版本 */
    export const USE_AUTO_VERSION = true;

    /**@description Loading动画显示超时回调默认超时时间 */
    export const LOADING_TIME_OUT = 30;

    /**@description Loading提示中切换显示内容的时间间隔 */
    export const LOADING_CONTENT_CHANGE_INTERVAL = 3;

    /**@description 加载界面超时时间,如果在LOAD_VIEW_TIME_OUT秒未加载出，提示玩家加载界面超时 */
    export const LOAD_VIEW_TIME_OUT = 20;

    /**@description UILoading显示默认时间，即在打开界面时，如果界面在LOAD_VIEW_DELAY之内未显示，就会弹出一的加载界面的进度 
     * 在打开界面时，也可直接指定delay的值
     * @example  
     * Manager.uiManager.open({ type : LoginLayer, zIndex: ViewZOrder.zero, delay : 0.2});
     */
    export const LOAD_VIEW_DELAY = 0.1;

    /**@description 重连的超时时间 */
    export const RECONNECT_TIME_OUT = 30;

    /**@description 进入后台最大时间（单位秒）大于这个时间时就会进入重连*/
    export const MAX_INBACKGROUND_TIME = 60;
    /**@description 进入后台最小时间（单位秒）大于这个时间时就会进入重连*/
    export const MIN_INBACKGROUND_TIME = 5;

    export const BUNDLES: BundleData[] = [
        { sort: Sort.aimLine, type: Types.aimLine, name: { CN: "瞄准线", EN: "Aim Line" }, bundle: eTypes[Types.aimLine] },
        { sort: Sort.eliminate, type: Types.eliminate, name: { CN: "爱消除", EN: "Eliminate" }, bundle: eTypes[Types.eliminate] },
        { sort: Sort.loadTest, type: Types.loadTest, name: { CN: "加载示例", EN: "Load Test" }, bundle: eTypes[Types.loadTest] },
        { sort: Sort.netTest, type: Types.netTest, name: { CN: "网络示例", EN: "Net Test" }, bundle: eTypes[Types.netTest] },
        { sort: Sort.nodePoolTest, type: Types.nodePoolTest, name: { CN: "对象池示例", EN: "Node Pool" }, bundle: eTypes[Types.nodePoolTest] },
        { sort: Sort.tankBattle, type: Types.tankBattle, name: { CN: "坦克大战", EN: "BATTLE\nCITY" }, bundle: eTypes[Types.tankBattle] },
        { sort: Sort.shaders, type: Types.shaders, name: { CN: "Shaders", EN: "Shaders" }, bundle: eTypes[Types.shaders] },
        { sort: Sort.resources, type: Types.resources, name: { CN: "主包", EN: "Main" }, bundle: eTypes[Types.resources] },
        { sort: Sort.hall, type: Types.hall, name: { CN: "大厅", EN: "Hall" }, bundle: eTypes[Types.hall] },
        { sort: Sort.scratchTicket, type: Types.scratchTicket, name: { CN: "刮奖", EN: "Scratch\nTicket" }, bundle: eTypes[Types.scratchTicket] },
        { sort: Sort.snapshot, type: Types.snapshot, name: { CN: "截图", EN: "Snapshot" }, bundle: eTypes[Types.snapshot] },
        { sort: Sort.escapeStation, type: Types.escapeStation, name: { CN: "逃离车站", EN: "Escape\nStation" }, bundle: eTypes[Types.escapeStation] },
        { sort: Sort.stateMachine, type: Types.stateMachine, name: { CN: "状态机", EN: "State\nMachine" }, bundle: eTypes[Types.stateMachine] },
        { sort: Sort.qrcode, type: Types.qrcode, name: { CN: "二维码", EN: "QR Code" }, bundle: eTypes[Types.qrcode] },
        { sort: Sort.hollowOut, type: Types.hollowOut, name: { CN: "挖孔引导", EN: "Hollow Out" }, bundle: eTypes[Types.hollowOut] },
    ];
}

/**
 * @description 界面层级定义
 */

export namespace ViewZOrder {


    /**@description 最底层 */
    export const zero = 0;

    /**@description 小喇叭显示层 */
    export const Horn = 10;

    /**@description ui层 */
    export const UI = 100;

    /**@description 提示 */
    export const Tips = 300;

    /**@description 提示弹出框 */
    export const Alert = 299;

    /**@description Loading层 */
    export const Loading = 600;

    /**@description 界面加载动画层，暂时放到最高层，加载动画时，界面未打开完成时，不让玩家点击其它地方 */
    export const UILoading = 700;
}

/**@description 网络优先级,值越大，优化级越高 */
export enum NetPriority {
    Game,
    Chat,
    Lobby,
}